package com.vancouver.knows.ui.fragment.citydiscount;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

import com.pangu.ui.refresh.ARefreshViewController;
import com.pangu.ui.refresh.RefreshControllerView;
import com.vancouver.knows.business.task.mark.FetchCityDiscountsTaskMark;

/**
 * 城事下拉界面
 * 
 * @author chenxunlin01
 * 
 */
public class CityDiscountPullControllerView extends RefreshControllerView {

	public CityDiscountPullControllerView(Context context) {
		super(context);
	}

	public CityDiscountPullControllerView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@Override
	public void onRefresh(ARefreshViewController controller) {
		((CityDiscountListView) content).handleRefreshLoadItem();
	}

	public void loadData(FetchCityDiscountsTaskMark aTaskMark) {
		((CityDiscountListView) content).initLoadableView(aTaskMark);
	}

	public void setQrCode(String qrCode) {
		((CityDiscountListView) content).setQrCode(qrCode);
	}

	public void flush() {
		((CityDiscountListView) content).notifyDataSetChanged();
	}

	@Override
	protected View createContentView() {
		return new CityDiscountListView(getContext(), this);
	}

}
